package com.example.test_gen.fastorm;

import java.util.List;

public class ValueOpt {

    public static ValueType eq(Object val) {
        return new ValueType("=", val);
    }

    public static ValueType ne(Object val) {
        return new ValueType("!=", val);
    }

    public static ValueType lt(Object val) {
        return new ValueType("<", val);
    }

    public static ValueType le(Object val) {
        return new ValueType("<=", val);
    }

    public static ValueType gt(Object val) {
        return new ValueType(">", val);
    }

    public static ValueType ge(Object val) {
        return new ValueType(">=", val);
    }

    public static ValueType like(Object val) {
        return new ValueType("LIKE", val);
    }

    public static ValueType notLike(Object val) {
        return new ValueType("NOT LIKE", val);
    }

    public static ValueType in(List<Object> val) {
        return new ValueType("IN", val);
    }

    public static ValueType notIn(List<Object> val) {
        return new ValueType("NOT IN", val);
    }

    public static ValueType between(List<Object> val) {
        return new ValueType("BETWEEN", val);
    }

    public static ValueType notBetween(List<Object> val) {
        return new ValueType("NOT BETWEEN", val);
    }

    public static TableField as(TableField tableField, TableField newFieldName){
        return new TableField(""+tableField.fieldName+"", newFieldName.fieldName);
    }

    public static TableField countAs(TableField tableField, TableField newFieldName){
        return new TableField("COUNT("+tableField.fieldName+")", newFieldName.fieldName);
    }

    public static TableField sumAs(TableField tableField, TableField newFieldName){
        return new TableField("SUM("+tableField.fieldName+")", newFieldName.fieldName);
    }

    public static TableField avgAs(TableField tableField, TableField newFieldName){
        return new TableField("AVG("+tableField.fieldName+")", newFieldName.fieldName);
    }
}